package cn.jinzhu.openfeign;

import cn.jinzhu.entity.User;
import cn.jinzhu.openfeign.service.HelloService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;


@RestController
public class HelloController {
    @Resource
    HelloService helloService;
    @GetMapping("/hello")
    public String Hello() throws UnsupportedEncodingException {
        System.out.println(helloService.hello1("金柱"));
        User user= new User();
        user.setId(1);
        user.setName("金");
        user.setPass("jj");
        System.out.println(helloService.hello3(user));
        System.out.println(helloService.delete1(1));
        System.out.println(helloService.GetUserByName(URLEncoder.encode("你好","UTF-8")));
        return helloService.hello();
    }
}
